use JSON::RPC::Client;

my $client = new JSON::RPC::Client;
my $url    = 'http://127.0.0.1:7080/';

my $callobj = {
   method  => 'add',
   params  => [ 17, 25 ], # ex.) params => { a => 20, b => 10 } for JSON-RPC v1.1
};

my $res = $client->call($uri, $callobj);

if($res) {
   if ($res->is_error) {
       print "Error : ", $res->error_message;
   }
   else {
       print $res->result;
   }
}
else {
   print $client->status_line;
}
   
